<!--
 * @Author: wangming
 * @Date: 2021-09-29 15:27:14
 * @LastEditors: wangming
 * @LastEditTime: 2022-01-28 11:07:17
 * @FilePath: /hanma-application-designer-fed/src/components/DesignPreview/template.vue
 * @Description: 
-->
<template>
  <el-drawer :visible.sync="drawer" direction="rtl" size="100%">
    <template slot="title">
      <div>
        <el-button @click="drawer = false"> 关闭 </el-button>
        <h3 class="dib ml10 pl20">
          <span class="dib f18 mr10">PC 页面设计预览</span>
          <b>( {{ title }} )</b>
        </h3>
      </div>
    </template>
    <universal
      v-if="drawer"
      :formList="formList"
      :hmpageInfo="hmpageInfo"
      :formData="formData"
    ></universal>
  </el-drawer>
</template>

<script>
import universal from "@/pageComponents/main/index.vue";
import { cloneDeep } from "lodash";
export default {
  components: { universal },
  data() {
    return {
      hmpageInfo: {},
      drawer: false,
      formList: [],
      title: "表单",
      formData: {},
    };
  },
  methods: {
    openDrawer(data) {
      let { hmpageInfo, formList, title } = cloneDeep(data);
      this.hmpageInfo = hmpageInfo;
      this.formList = formList;
      this.title = title;
      this.drawer = true;
    },
  },
};
</script>

<style scoped lang="scss">
</style>
